﻿<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.0 Transitional//EN">
<html>
    <head>
        <title></title>
        <link type="text/css" href="css/qunit.css" rel="stylesheet" />
        <link type="text/css" href="css/qunit-host.css" rel="stylesheet" />
        <style type="text/css">
            #external-html-viewport 
            {
                border: solid 2px black;
                display: none;
                margin: 5px;
                padding: 5px;
            }
        </style>
        <script src="scripts/jquery-1.7.1.min.js"></script>
        <script src="scripts/linq.min.js"></script>
        <script src="scripts/qunit.js"></script>
        <script src="scripts/qunit-host.js"></script>
        <script src="scripts/Utils.js"></script>
        <script src="acceptance/acceptance.js"></script>
        <script src="chrome://namfox/content/Namespace.js"></script>
        <script src="chrome://namfox/content/utilities/BigInteger.js"></script>
        <script src="chrome://namfox/content/utilities/Color.js"></script>
        <script src="chrome://namfox/content/utilities/FXDom.js"></script>
        <script src="chrome://namfox/content/utilities/Xpcom.js"></script>
        <script src="chrome://namfox/content/utilities/ModerationQueueStatus.js"></script>
        <script src="chrome://namfox/content/utilities/Post.js"></script>
        <script src="chrome://namfox/content/utilities/Markup.js"></script>
        <script src="chrome://namfox/content/enhancements/markup-strip/MarkupStripper.js"></script>
        <script src="chrome://namfox/content/utilities/MarkupTranslator.js"></script>
        <script>
            var relativeDir = null;
            var _document = null;

            function loadTest() {
                var scriptUrl = document.location.href.match(/\?script=(.*)/);

                if (!scriptUrl) {
                    alert("Please specify a script using the script parameter in the query string.");
                    return;
                }

                var script = scriptUrl[1];
                name(script);

                var scriptElement = document.createElement("script");
                scriptElement.src = script;

                var matches = script.match(/chrome:\/\/(.*)\/(.*?)\.js/);
                relativeDir = matches[1] + "/";

                var h = document.getElementsByTagName("head")[0];
                h.appendChild(scriptElement);
            }

            function name(name) {
                document.getElementById("qunit-header").innerHTML = name;
            }

            function html(htmlSource) {
                var xhr = new XMLHttpRequest();
                xhr.open("GET", "chrome://" + relativeDir + htmlSource, false);
                xhr.send(null);

                var viewport = document.getElementById("external-html-viewport");
                viewport.style.display = "block";
                viewport.innerHTML = xhr.responseText;
            }

            window.addEventListener("DOMContentLoaded", loadTest, false);
        </script>
    </head>
    <body>
        <h1 id="qunit-header">Unit Test Case</h1>
        <h2 id="qunit-banner"></h2>
        <h2 id="qunit-userAgent"></h2>
        <ol id="qunit-tests"></ol>
        <div id="external-html-viewport"></div>
    </body>
</html>